<template>
  <div class="more-container">
    <el-row>
      <el-col :span="12" class="sub left">
        <h3 style="text-align: center">
          科目二规则
          <span class="fuzhibtn" @click="copyData(2)">复制到科三-></span>
        </h3>
        <el-form
          ref="formDataRuler2"
          :model="formDataRuler2"
          :rules="rulesRuler2"
          size="small"
          label-width="180px"
        >
          <el-row>
            <el-col :span="24">
              <el-form-item label="科二约课" prop="status">
                <el-switch
                  v-model="formDataRuler2.status"
                  :active-value="1"
                  :inactive-value="0"
                ></el-switch>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="约课条件"  :prop="formDataRuler2.condition == 0 ? 'condition' : 'conditionV'">
                <el-radio-group v-model="formDataRuler2.condition">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">科一合格</el-radio>
                </el-radio-group>
                <el-input
                  v-model="formDataRuler2.conditionV"
                  style="width: 60px"
                  :disabled="formDataRuler2.condition != 1"
                ></el-input>

                <span class="addColor">天后可约</span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="学员约课时间"
                prop="openTime"
                class="tipsBox"
                :prop="formDataRuler2.openTime == 0 ? 'openTime' : !formDataRuler2.openTimeS?'openTimeS':'openTimeE'"
              >
                <el-radio-group v-model="formDataRuler2.openTime">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-time-select
                  placeholder="起始时间"
                  v-model="formDataRuler2.openTimeS"
                  :disabled="formDataRuler2.openTime != 1"
                  style="width: 120px"
                  :picker-options="{
                    start: '00:00',
                      step: '00:60',
                      end: '23:00',
                  }"
                ></el-time-select>
                <el-time-select
                  placeholder="结束时间"
                  ref="frequencyMinute"
                  v-model="formDataRuler2.openTimeE"
                  :disabled="formDataRuler2.openTime != 1"
                  style="width: 120px; margin-left: 20px"
                  :picker-options="{
                    start: '00:00',
                      step: '00:60',
                      end: '23:00',
                    minTime: formDataRuler2.openTimeS,
                  }"
                ></el-time-select>
                <span class="tips">
                  例如，设置8:00-9:00，则学员仅在这个时间内可以提交约课请求
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每天可上课时间"
                prop="learnTimeDay"
                class="tipsBox"
                  :prop="formDataRuler2.learnTimeDay == 0 ? 'learnTimeDay' : !formDataRuler2.learnTimeDayS?'learnTimeDayS':'learnTimeDayE'"
              >
                <el-radio-group v-model="formDataRuler2.learnTimeDay">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-time-select
                  placeholder="起始时间"
                  v-model="formDataRuler2.learnTimeDayS"
                  :disabled="formDataRuler2.learnTimeDay != 1"
                  style="width: 120px"
                   :picker-options="{
                    start: '00:00',
                      step: '00:60',
                      end: '23:00',
                  }"
                ></el-time-select>
                <el-time-select
                  placeholder="结束时间"
                  v-model="formDataRuler2.learnTimeDayE"
                  :disabled="formDataRuler2.learnTimeDay != 1"
                  style="width: 120px; margin-left: 20px"
                   :picker-options="{
                    start: '00:00',
                      step: '00:60',
                      end: '23:00',
                    minTime: formDataRuler2.learnTimeDayS,
                  }"
                ></el-time-select>
                <span class="tips">
                  如设置8:00-16:00，则学员自己只能预约8:00-16:00之间的课
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每周可上课时间"
                prop="learnTimeWeek"
                class="tipsBox"
                 :prop="formDataRuler2.learnTimeWeek == 0 ? 'learnTimeWeek' : 'learnTimeWeekV'"
              >
                <el-radio-group v-model="formDataRuler2.learnTimeWeek">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-select
                  v-model="formDataRuler2.learnTimeWeekV"
                  multiple
                  :disabled="formDataRuler2.learnTimeWeek != 1"
                  collapse-tags
                  style="width: 180px"
                >
                  <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
                <span class="tips">
                  如设置为周一到周五，则学员不可约周六日的课
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="是否可约当天课程"
                prop="todayAppoint"
                class="tipsBox"
              >
                <el-radio-group v-model="formDataRuler2.todayAppoint">
                  <el-radio :label="0">可约</el-radio>
                  <el-radio :label="1">不可约</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="学员最多可约天数"
                prop="moreAppoint"
                class="tipsBox"
                 :prop="!formDataRuler2.moreAppointDays  ? 'moreAppointDays' : 'moreAppointTime'"
              >
                <el-input
                  style="width: 120px"
                  v-model="formDataRuler2.moreAppointDays"
                >
                  <template slot="append">天</template>
                </el-input>
                <span class="tips">
                  如设置为3天且当天可约，则学员可预约3天的课程
                </span>
                <span class="addColor">最后一天放课时间为</span>
                <el-time-select
                  placeholder="起始时间"
                  v-model="formDataRuler2.moreAppointTime"
                  style="width: 120px"
                   :picker-options="{
                    start: '00:00',
                      step: '00:60',
                      end: '23:00',
                  }"
                ></el-time-select>
                <span class="addColor">以后</span>
                <span class="tips">
                  如可约3天，放课时间20:00，则第一天晚上20:00之后可约第三天的课
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="课表可见天数"
                prop="courseList"
                class="tipsBox"
                  :prop="formDataRuler2.courseList==0  ? 'courseList' : 'courseListV'"
              >
                <el-radio-group v-model="formDataRuler2.courseList">
                  <el-radio :label="0">与学员可约天数相同</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler2.courseList != 1"
                  style="width: 120px"
                  v-model="formDataRuler2.courseListV"
                >
                  <template slot="append">天</template>
                </el-input>
                <span class="tips">
                  如课表可见3天，最多可约2天且当天可约，则学员端可见排课天数为今天、明天、后天，但是仅今天和明天可约
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每天可上课时段数"
                prop="courseCountDay"
                class="tipsBox"
                 :prop="formDataRuler2.courseCountDay==0  ? 'courseCountDay' : 'courseCountDayV'"
              >
                <el-radio-group v-model="formDataRuler2.courseCountDay">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler2.courseCountDay != 1"
                  style="width: 120px"
                  v-model="formDataRuler2.courseCountDayV"
                >
                  <template slot="append">时段</template>
                </el-input>
                <span class="tips">
                  该限制指的是每天可以上几节课（即能预约几个格子）
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每周可上课时段数"
                prop="courseCountWeek"
                class="tipsBox"
                :prop="formDataRuler2.courseCountWeek==0  ? 'courseCountWeek' : 'courseCountWeekV'"
              >
                <el-radio-group v-model="formDataRuler2.courseCountWeek">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler2.courseCountWeek != 1"
                  style="width: 120px"
                  v-model="formDataRuler2.courseCountWeekV"
                >
                  <template slot="append">时段</template>
                </el-input>
                <span class="tips">
                  该限制指的是每周可以上几节课（即能预约几个格子）
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每天最大时长"
                prop="timeCountDay"
                class="tipsBox"
                 :prop="formDataRuler2.timeCountDay==0  ? 'timeCountDay' : 'timeCountDayV'"
              >
                <el-radio-group v-model="formDataRuler2.timeCountDay">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler2.timeCountDay != 1"
                  style="width: 120px"
                  v-model="formDataRuler2.timeCountDayV"
                >
                  <template slot="append">分钟</template>
                </el-input>
                <span class="tips">指每天预约成功+确认上车的课时总长</span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每周最大时长"
                prop="timeCountWeek"
                class="tipsBox"
                :prop="formDataRuler2.timeCountWeek==0  ? 'timeCountWeek' : 'timeCountWeekV'"
              >
                <el-radio-group v-model="formDataRuler2.timeCountWeek">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler2.timeCountWeek != 1"
                  style="width: 120px"
                  v-model="formDataRuler2.timeCountWeekV"
                >
                  <template slot="append">分钟</template>
                </el-input>
                <span class="tips">
                  指周一至周日预约成功+确认上车的课时总长
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="最大可提前预约时段数"
                prop="courseCountBefore"
                class="tipsBox"
                :prop="formDataRuler2.courseCountBefore==0  ? 'courseCountBefore' : 'courseCountBeforeV'"
              >
                <el-radio-group v-model="formDataRuler2.courseCountBefore">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler2.courseCountBefore != 1"
                  style="width: 120px"
                  v-model="formDataRuler2.courseCountBeforeV"
                >
                  <template slot="append">时段</template>
                </el-input>
                <span class="tips">
                  当需要限制学员提前预约的课程节数时，可使用该配置
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每天取消约课总次数限制"
                prop="cancelLimitDay"
                class="tipsBox"
                :prop="formDataRuler2.cancelLimitDay==0  ? 'cancelLimitDay' : 'cancelLimitDayV'"
              >
                <el-radio-group v-model="formDataRuler2.cancelLimitDay">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <span class="addColor" style="margin-left: 10px">当天取消</span>
                <el-input
                  style="width: 120px"
                  :disabled="formDataRuler2.cancelLimitDay != 1"
                  v-model="formDataRuler2.cancelLimitDayV"
                >
                  <template slot="append">次</template>
                </el-input>
                <span class="addColor">当天不可再约</span>
                <span class="tips">
                  如设置为2次，则当天只要操作取消约课2次，将被限制约课，次日自动解除限制
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="累计取消多次限制约课"
                prop="cancelLimitAll"
                class="tipsBox"
                :prop="formDataRuler2.cancelLimitAll==0  ? 'cancelLimitAll' : 'cancelLimitAllV'"
              >
                <el-radio-group v-model="formDataRuler2.cancelLimitAll">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <span class="addColor" style="margin-left: 10px">累计取消</span>
                <el-input
                  :disabled="formDataRuler2.cancelLimitAll != 1"
                  style="width: 120px"
                  v-model="formDataRuler2.cancelLimitAllV"
                >
                  <template slot="append">次</template>
                </el-input>
                <span class="addColor">自动限制学员约课</span>
                <span class="tips">
                  如设置为10次，则累计取消10次约课后，系统将自动限制该学员约课，需要驾校在后台解除限制后，才能恢复约课
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="累计爽约多次限制约课"
                prop="breakLimitAll"
                class="tipsBox"
                 :prop="formDataRuler2.breakLimitAll==0  ? 'breakLimitAll' : 'breakLimitAllV'"
              >
                <el-radio-group v-model="formDataRuler2.breakLimitAll">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <span class="addColor" style="margin-left: 10px">累计爽约</span>
                <el-input
                  :disabled="formDataRuler2.breakLimitAll != 1"
                  style="width: 120px"
                  v-model="formDataRuler2.breakLimitAllV"
                >
                  <template slot="append">次</template>
                </el-input>
                <span class="addColor">自动限制学员约课</span>
                <span class="tips">
                  如设置为10次，则累计爽约10次未去训练，系统将自动限制该学员约课，可设置自动解禁时间或在后台手动解除限制
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="上课前几小时不可取消"
                prop="cancelLimit"
                class="tipsBox"
                :prop="formDataRuler2.cancelLimit==0  ? 'cancelLimit' : 'cancelLimitV'"
              >
                <el-radio-group v-model="formDataRuler2.cancelLimit">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler2.cancelLimit != 1"
                  style="width: 120px"
                  v-model="formDataRuler2.cancelLimitV"
                >
                  <template slot="append">小时</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="上课前几小时不可约课"
                prop="courseLimit"
                class="tipsBox"
                :prop="formDataRuler2.courseLimit==0  ? 'courseLimit' : 'courseLimitV'"
              >
                <el-radio-group v-model="formDataRuler2.courseLimit">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler2.courseLimit != 1"
                  style="width: 120px"
                  v-model="formDataRuler2.courseLimitV"
                >
                  <template slot="append">小时</template>
                </el-input>
                <span class="tips">
                  如设置为1小时，当前时间为11:00，则预约当天课程时，只能预约开始时间为12：00之后的课
                </span>
              </el-form-item>
            </el-col>

            <el-col :span="24">
              <el-form-item
                label="欠费是否限制学员约课"
                prop="moneyLimit"
                class="tipsBox"
                :prop="formDataRuler2.moneyLimit==0  ? 'moneyLimit' : 'moneyLimitV'"
              >
                <el-radio-group v-model="formDataRuler2.moneyLimit">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <span class="addColor" style="margin-left: 10px">
                  欠费金额大于￥
                </span>
                <el-input
                  :disabled="formDataRuler2.moneyLimit != 1"
                  style="width: 120px"
                  v-model="formDataRuler2.moneyLimitV"
                ></el-input>
                <span class="addColor">不可约课</span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="计时学车取消规则"
                prop="cancelRule"
                class="tipsBox"
                 :prop="!formDataRuler2.cancelRuleFree? 'cancelRuleFree' : !formDataRuler2.cancelRuleDeduction?'cancelRuleDeduction':!formDataRuler2.cancelRuleLimit?'cancelRuleLimit':'cancelRuleBreakRate'"
              >
                <el-col :span="24" style="margin-bottom:8px">
                  <span class="addColor">1.离练车开始时间></span>
                  <el-input
                    style="width: 120px"
                    v-model="formDataRuler2.cancelRuleFree"
                  >
                    <template slot="append">小时</template>
                  </el-input>
                  <span class="addColor">可免费取消</span>
                </el-col>
                <el-col :span="24" style="margin-bottom:8px">
                  <span class="addColor">2.离练车开始时间<</span>
                  <el-input
                    style="width: 120px"
                    v-model="formDataRuler2.cancelRuleFree"
                  >
                    <template slot="append">小时</template>
                  </el-input>
                  <span class="addColor">,取消时收取订单费用的</span>
                  <el-input
                    style="width: 120px"
                    v-model="formDataRuler2.cancelRuleDeduction"
                  >
                    <template slot="append">%</template>
                  </el-input>
                  <span class="addColor">用于补偿教练</span>
                </el-col>
                <el-col :span="24" style="margin-bottom:8px">
                  <span class="addColor">3.离练车开始时间<</span>
                  <el-input
                    style="width: 120px"
                    v-model="formDataRuler2.cancelRuleLimit"
                  >
                    <template slot="append">小时</template>
                  </el-input>
                  <span class="addColor">不可取消</span>
                </el-col>
                <el-col :span="24" style="margin-bottom:8px">
                  <span class="addColor">4.无故旷课，收取订单费用的</span>
                  <el-input
                    style="width: 120px"
                    v-model="formDataRuler2.cancelRuleBreakRate"
                  >
                    <template slot="append">%</template>
                  </el-input>
                  <span class="addColor">用于补偿教练</span>
                </el-col>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-col>
      <el-col :span="12" class="sub">
        <h3 style="text-align: center">
          科目三规则
          <span class="fuzhibtn"  @click="copyData(3)"><-复制到科二</span>
        </h3>
        <el-form
          ref="formDataRuler3"
          :model="formDataRuler3"
          :rules="rulesRuler3"
          size="small"
          label-width="180px"
        >
          <el-row>
            <el-col :span="24">
              <el-form-item label="科三约课" prop="status">
                <el-switch
                  v-model="formDataRuler3.status"
                  :active-value="1"
                  :inactive-value="0"
                ></el-switch>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="约课条件"  :prop="formDataRuler3.condition == 0 ? 'condition' : 'conditionV'">
                <el-radio-group v-model="formDataRuler3.condition">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">科二合格</el-radio>
                </el-radio-group>
                <el-input
                  v-model="formDataRuler3.conditionV"
                  style="width: 60px"
                  :disabled="formDataRuler3.condition != 1"
                ></el-input>

                <span class="addColor">天后可约</span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="学员约课时间"
                prop="openTime"
                class="tipsBox"
                :prop="formDataRuler3.openTime == 0 ? 'openTime' : !formDataRuler3.openTimeS?'openTimeS':'openTimeE'"
              >
                <el-radio-group v-model="formDataRuler3.openTime">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-time-select
                  placeholder="起始时间"
                  v-model="formDataRuler3.openTimeS"
                  :disabled="formDataRuler3.openTime != 1"
                  style="width: 120px"
                  :picker-options="{
                    start: '00:00',
                      step: '00:60',
                      end: '23:00',

                  }"
                ></el-time-select>
                <el-time-select
                  placeholder="结束时间"
                  ref="frequencyMinute"
                  v-model="formDataRuler3.openTimeE"
                  :disabled="formDataRuler3.openTime != 1"
                  style="width: 120px; margin-left: 20px"
                  :picker-options="{
                    start: '00:00',
                      step: '00:60',
                      end: '23:00',

                    minTime: formDataRuler3.openTimeS,
                  }"
                ></el-time-select>
                <span class="tips">
                  例如，设置8:00-9:00，则学员仅在这个时间内可以提交约课请求
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每天可上课时间"
                prop="learnTimeDay"
                class="tipsBox"
                  :prop="formDataRuler3.learnTimeDay == 0 ? 'learnTimeDay' : !formDataRuler3.learnTimeDayS?'learnTimeDayS':'learnTimeDayE'"
              >
                <el-radio-group v-model="formDataRuler3.learnTimeDay">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-time-select
                  placeholder="起始时间"
                  v-model="formDataRuler3.learnTimeDayS"
                  :disabled="formDataRuler3.learnTimeDay != 1"
                  style="width: 120px"
                  :picker-options="{
                    start: '00:00',
                      step: '00:60',
                      end: '23:00',

                  }"
                ></el-time-select>
                <el-time-select
                  placeholder="结束时间"
                  v-model="formDataRuler3.learnTimeDayE"
                  :disabled="formDataRuler3.learnTimeDay != 1"
                  style="width: 120px; margin-left: 20px"
                  :picker-options="{
                    start: '00:00',
                      step: '00:60',
                      end: '23:00',
                    minTime: formDataRuler3.learnTimeDayS,
                  }"
                ></el-time-select>
                <span class="tips">
                  如设置8:00-16:00，则学员自己只能预约8:00-16:00之间的课
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每周可上课时间"
                prop="learnTimeWeek"
                class="tipsBox"
                 :prop="formDataRuler3.learnTimeWeek == 0 ? 'learnTimeWeek' : 'learnTimeWeekV'"
              >
                <el-radio-group v-model="formDataRuler3.learnTimeWeek">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-select
                  v-model="formDataRuler3.learnTimeWeekV"
                  multiple
                  :disabled="formDataRuler3.learnTimeWeek != 1"
                  collapse-tags
                  style="width: 180px"
                >
                  <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
                <span class="tips">
                  如设置为周一到周五，则学员不可约周六日的课
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="是否可约当天课程"
                prop="todayAppoint"
                class="tipsBox"
              >
                <el-radio-group v-model="formDataRuler3.todayAppoint">
                  <el-radio :label="0">可约</el-radio>
                  <el-radio :label="1">不可约</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="学员最多可约天数"
                prop="moreAppoint"
                class="tipsBox"
                 :prop="!formDataRuler3.moreAppointDays  ? 'moreAppointDays' : 'moreAppointTime'"
              >
                <el-input
                  style="width: 120px"
                  v-model="formDataRuler3.moreAppointDays"
                >
                  <template slot="append">天</template>
                </el-input>
                <span class="tips">
                  如设置为3天且当天可约，则学员可预约3天的课程
                </span>
                <span class="addColor">最后一天放课时间为</span>
                <el-time-select
                  placeholder="起始时间"
                  v-model="formDataRuler3.moreAppointTime"
                  style="width: 120px"
                  :picker-options="{
                    start: '00:00',
                      step: '00:60',
                      end: '23:00',
                  }"
                ></el-time-select>
                <span class="addColor">以后</span>
                <span class="tips">
                  如可约3天，放课时间20:00，则第一天晚上20:00之后可约第三天的课
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="课表可见天数"
                prop="courseList"
                class="tipsBox"
                  :prop="formDataRuler3.courseList==0  ? 'courseList' : 'courseListV'"
              >
                <el-radio-group v-model="formDataRuler3.courseList">
                  <el-radio :label="0">与学员可约天数相同</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler3.courseList != 1"
                  style="width: 120px"
                  v-model="formDataRuler3.courseListV"
                >
                  <template slot="append">天</template>
                </el-input>
                <span class="tips">
                  如课表可见3天，最多可约2天且当天可约，则学员端可见排课天数为今天、明天、后天，但是仅今天和明天可约
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每天可上课时段数"
                prop="courseCountDay"
                class="tipsBox"
                 :prop="formDataRuler3.courseCountDay==0  ? 'courseCountDay' : 'courseCountDayV'"
              >
                <el-radio-group v-model="formDataRuler3.courseCountDay">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler3.courseCountDay != 1"
                  style="width: 120px"
                  v-model="formDataRuler3.courseCountDayV"
                >
                  <template slot="append">时段</template>
                </el-input>
                <span class="tips">
                  该限制指的是每天可以上几节课（即能预约几个格子）
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每周可上课时段数"
                prop="courseCountWeek"
                class="tipsBox"
                :prop="formDataRuler3.courseCountWeek==0  ? 'courseCountWeek' : 'courseCountWeekV'"
              >
                <el-radio-group v-model="formDataRuler3.courseCountWeek">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler3.courseCountWeek != 1"
                  style="width: 120px"
                  v-model="formDataRuler3.courseCountWeekV"
                >
                  <template slot="append">时段</template>
                </el-input>
                <span class="tips">
                  该限制指的是每周可以上几节课（即能预约几个格子）
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每天最大时长"
                prop="timeCountDay"
                class="tipsBox"
                 :prop="formDataRuler3.timeCountDay==0  ? 'timeCountDay' : 'timeCountDayV'"
              >
                <el-radio-group v-model="formDataRuler3.timeCountDay">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler3.timeCountDay != 1"
                  style="width: 120px"
                  v-model="formDataRuler3.timeCountDayV"
                >
                  <template slot="append">分钟</template>
                </el-input>
                <span class="tips">指每天预约成功+确认上车的课时总长</span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每周最大时长"
                prop="timeCountWeek"
                class="tipsBox"
                :prop="formDataRuler3.timeCountWeek==0  ? 'timeCountWeek' : 'timeCountWeekV'"
              >
                <el-radio-group v-model="formDataRuler3.timeCountWeek">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler3.timeCountWeek != 1"
                  style="width: 120px"
                  v-model="formDataRuler3.timeCountWeekV"
                >
                  <template slot="append">分钟</template>
                </el-input>
                <span class="tips">
                  指周一至周日预约成功+确认上车的课时总长
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="最大可提前预约时段数"
                prop="courseCountBefore"
                class="tipsBox"
                :prop="formDataRuler3.courseCountBefore==0  ? 'courseCountBefore' : 'courseCountBeforeV'"
              >
                <el-radio-group v-model="formDataRuler3.courseCountBefore">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler3.courseCountBefore != 1"
                  style="width: 120px"
                  v-model="formDataRuler3.courseCountBeforeV"
                >
                  <template slot="append">时段</template>
                </el-input>
                <span class="tips">
                  当需要限制学员提前预约的课程节数时，可使用该配置
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="每天取消约课总次数限制"
                prop="cancelLimitDay"
                class="tipsBox"
                :prop="formDataRuler3.cancelLimitDay==0  ? 'cancelLimitDay' : 'cancelLimitDayV'"
              >
                <el-radio-group v-model="formDataRuler3.cancelLimitDay">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <span class="addColor" style="margin-left: 10px">当天取消</span>
                <el-input
                  style="width: 120px"
                  :disabled="formDataRuler3.cancelLimitDay != 1"
                  v-model="formDataRuler3.cancelLimitDayV"
                >
                  <template slot="append">次</template>
                </el-input>
                <span class="addColor">当天不可再约</span>
                <span class="tips">
                  如设置为2次，则当天只要操作取消约课2次，将被限制约课，次日自动解除限制
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="累计取消多次限制约课"
                prop="cancelLimitAll"
                class="tipsBox"
                :prop="formDataRuler3.cancelLimitAll==0  ? 'cancelLimitAll' : 'cancelLimitAllV'"
              >
                <el-radio-group v-model="formDataRuler3.cancelLimitAll">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <span class="addColor" style="margin-left: 10px">累计取消</span>
                <el-input
                  :disabled="formDataRuler3.cancelLimitAll != 1"
                  style="width: 120px"
                  v-model="formDataRuler3.cancelLimitAllV"
                >
                  <template slot="append">次</template>
                </el-input>
                <span class="addColor">自动限制学员约课</span>
                <span class="tips">
                  如设置为10次，则累计取消10次约课后，系统将自动限制该学员约课，需要驾校在后台解除限制后，才能恢复约课
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="累计爽约多次限制约课"
                prop="breakLimitAll"
                class="tipsBox"
                 :prop="formDataRuler3.breakLimitAll==0  ? 'breakLimitAll' : 'breakLimitAllV'"
              >
                <el-radio-group v-model="formDataRuler3.breakLimitAll">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <span class="addColor" style="margin-left: 10px">累计爽约</span>
                <el-input
                  :disabled="formDataRuler3.breakLimitAll != 1"
                  style="width: 120px"
                  v-model="formDataRuler3.breakLimitAllV"
                >
                  <template slot="append">次</template>
                </el-input>
                <span class="addColor">自动限制学员约课</span>
                <span class="tips">
                  如设置为10次，则累计爽约10次未去训练，系统将自动限制该学员约课，可设置自动解禁时间或在后台手动解除限制
                </span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="上课前几小时不可取消"
                prop="cancelLimit"
                class="tipsBox"
                :prop="formDataRuler3.cancelLimit==0  ? 'cancelLimit' : 'cancelLimitV'"
              >
                <el-radio-group v-model="formDataRuler3.cancelLimit">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler3.cancelLimit != 1"
                  style="width: 120px"
                  v-model="formDataRuler3.cancelLimitV"
                >
                  <template slot="append">小时</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="上课前几小时不可约课"
                prop="courseLimit"
                class="tipsBox"
                :prop="formDataRuler3.courseLimit==0  ? 'courseLimit' : 'courseLimitV'"
              >
                <el-radio-group v-model="formDataRuler3.courseLimit">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <el-input
                  :disabled="formDataRuler3.courseLimit != 1"
                  style="width: 120px"
                  v-model="formDataRuler3.courseLimitV"
                >
                  <template slot="append">小时</template>
                </el-input>
                <span class="tips">
                  如设置为1小时，当前时间为11:00，则预约当天课程时，只能预约开始时间为12：00之后的课
                </span>
              </el-form-item>
            </el-col>

            <el-col :span="24">
              <el-form-item
                label="欠费是否限制学员约课"
                prop="moneyLimit"
                class="tipsBox"
                :prop="formDataRuler3.moneyLimit==0  ? 'moneyLimit' : 'moneyLimitV'"
              >
                <el-radio-group v-model="formDataRuler3.moneyLimit">
                  <el-radio :label="0">不限</el-radio>
                  <el-radio :label="1">自定义</el-radio>
                </el-radio-group>
                <span class="addColor" style="margin-left: 10px">
                  欠费金额大于￥
                </span>
                <el-input
                  :disabled="formDataRuler3.moneyLimit != 1"
                  style="width: 120px"
                  v-model="formDataRuler3.moneyLimitV"
                ></el-input>
                <span class="addColor">不可约课</span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item
                label="计时学车取消规则"
                prop="cancelRule"
                class="tipsBox"
                 :prop="!formDataRuler3.cancelRuleFree? 'cancelRuleFree' : !formDataRuler3.cancelRuleDeduction?'cancelRuleDeduction':!formDataRuler3.cancelRuleLimit?'cancelRuleLimit':'cancelRuleBreakRate'"
              >
                <el-col :span="24" style="margin-bottom:8px">
                  <span class="addColor">1.离练车开始时间></span>
                  <el-input
                    style="width: 120px"
                    v-model="formDataRuler3.cancelRuleFree"
                  >
                    <template slot="append">小时</template>
                  </el-input>
                  <span class="addColor">可免费取消</span>
                </el-col>
                <el-col :span="24" style="margin-bottom:8px">
                  <span class="addColor">2.离练车开始时间<</span>
                  <el-input
                    style="width: 120px"
                    v-model="formDataRuler3.cancelRuleFree"
                  >
                    <template slot="append">小时</template>
                  </el-input>
                  <span class="addColor">,取消时收取订单费用的</span>
                  <el-input
                    style="width: 120px"
                    v-model="formDataRuler3.cancelRuleDeduction"
                  >
                    <template slot="append">%</template>
                  </el-input>
                  <span class="addColor">用于补偿教练</span>
                </el-col>
                <el-col :span="24" style="margin-bottom:8px">
                  <span class="addColor">3.离练车开始时间<</span>
                  <el-input
                    style="width: 120px"
                    v-model="formDataRuler3.cancelRuleLimit"
                  >
                    <template slot="append">小时</template>
                  </el-input>
                  <span class="addColor">不可取消</span>
                </el-col>
                <el-col :span="24" style="margin-bottom:8px">
                  <span class="addColor">4.无故旷课，收取订单费用的</span>
                  <el-input
                    style="width: 120px"
                    v-model="formDataRuler3.cancelRuleBreakRate"
                  >
                    <template slot="append">%</template>
                  </el-input>
                  <span class="addColor">用于补偿教练</span>
                </el-col>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-col>
    </el-row>
    <el-row>
      <el-button
        type="primary"
        @click="confirmbtn"
        size="medium"
        style="margin-top: 20px"
      >
        提 交
      </el-button>
    </el-row>
  </div>
</template>
<script>
import {courserule,courseruleSetting} from '@/api/student'
export default {

  components: {},
  data() {
    return {
      formDataRuler2: {
          status: 1,
        condition: 0,
        openTime: 0,
        learnTimeDay: 0,
        learnTimeWeek: 0,
        todayAppoint: 0,
        courseList: 0,
        courseCountDay: 0,
        courseCountWeek: 0,
        timeCountDay: 0,
        timeCountWeek: 0,
        courseCountBefore: 0,
        cancelLimitDay: 0,
        cancelLimitAll: 0,
        breakLimitAll: 0,
        cancelLimit: 0,
        courseLimit: 0,
        moneyLimit: 0,
      },
      formDataRuler3: {
        status:1,
        condition: 0,
        openTime: 0,
        learnTimeDay: 0,
        learnTimeWeek: 0,
        todayAppoint: 0,
        courseList: 0,
        courseCountDay: 0,
        courseCountWeek: 0,
        timeCountDay: 0,
        timeCountWeek: 0,
        courseCountBefore: 0,
        cancelLimitDay: 0,
        cancelLimitAll: 0,
        breakLimitAll: 0,
        cancelLimit: 0,
        courseLimit: 0,
        moneyLimit: 0,
      },
      rulesRuler2: {
        status: [
          {
            required: true,
            message: '请选择是否开启',
            trigger: 'change',
          },
        ],
        condition: [
          {
            required: true,
            message: '请选择约课条件',
            trigger: 'change',
          },
        ],
        conditionV: [
          {
            required: true,
            message: '请输入约课条件天数',
            trigger: 'change',
          },
        ],
        openTime: [
          {
            required: true,
            message: '请设置学员约课时间',
            trigger: 'change',
          },
        ],
        openTimeS: [
          {
            required: true,
            message: '请设置学员约课时间',
            trigger: 'change',
          },
        ],
        openTimeE: [
          {
            required: true,
            message: '请设置学员约课时间',
            trigger: 'change',
          },
        ],
        moreAppointDays: [
          {
            required: true,
            message: '请输入天数',
            trigger: 'change',
          },
        ],
        moreAppointTime: [
          {
            required: true,
            message: '请选择时间',
            trigger: 'change',
          },
        ],
        todayAppoint: [
          {
            required: true,
            message: '请设置是否可约当天课程',
            trigger: 'change',
          },
        ],
        learnTimeDay: [
          {
            required: true,
            message: '请设置每天可上课时间',
            trigger: 'change',
          },
        ],
        learnTimeDayS: [
          {
            required: true,
            message: '请设置每天可上课时间',
            trigger: 'change',
          },
        ],
        learnTimeDayE: [
          {
            required: true,
            message: '请设置每天可上课时间',
            trigger: 'change',
          },
        ],
        learnTimeWeek: [
          {
            required: true,
            message: '请设置每周可上课时间',
            trigger: 'change',
          },
        ],
        learnTimeWeekV: [
          {
            required: true,
            message: '请设置每周可上课时间',
            trigger: 'change',
          },
        ],
        courseList: [
          {
            required: true,
            message: '请设置课表可见天数',
            trigger: 'change',
          },
        ],
        courseListV: [
          {
            required: true,
            message: '请设置课表可见天数',
            trigger: 'change',
          },
        ],
        courseCountDay: [
          {
            required: true,
            message: '请设置每天可上课时段数',
            trigger: 'change',
          },
        ],
        courseCountDayV: [
          {
            required: true,
            message: '请设置每天可上课时段数',
            trigger: 'change',
          },
        ],
        courseCountWeek: [
          {
            required: true,
            message: '请设置每周可上课时段数',
            trigger: 'change',
          },
        ],
        courseCountWeekV: [
          {
            required: true,
            message: '请设置每周可上课时段数',
            trigger: 'change',
          },
        ],
        timeCountDay: [
          {
            required: true,
            message: '请设置每天最大时长',
            trigger: 'change',
          },
        ],
        timeCountDayV: [
          {
            required: true,
            message: '请设置每天最大时长',
            trigger: 'change',
          },
        ],
        timeCountWeek: [
          {
            required: true,
            message: '请设置每周最大时长',
            trigger: 'change',
          },
        ],
        timeCountWeekV: [
          {
            required: true,
            message: '请设置每周最大时长',
            trigger: 'change',
          },
        ],
        courseCountBefore: [
          {
            required: true,
            message: '请输入最大可提前预约时段数',
            trigger: 'change',
          },
        ],
        courseCountBeforeV: [
          {
            required: true,
            message: '请输入最大可提前预约时段数',
            trigger: 'change',
          },
        ],
        cancelLimitDay: [
          {
            required: true,
            message: '请输入每天取消约课总次数限制',
            trigger: 'change',
          },
        ],
        cancelLimitDayV: [
          {
            required: true,
            message: '请输入每天取消约课总次数限制',
            trigger: 'change',
          },
        ],
        cancelLimitAll: [
          {
            required: true,
            message: '请输入累计取消多次限制约课次数',
            trigger: 'change',
          },
        ],
        cancelLimitAllV: [
          {
            required: true,
            message: '请输入累计取消多次限制约课次数',
            trigger: 'change',
          },
        ],
        breakLimitAll: [
          {
            required: true,
            message: '请输入累计爽约多次限制约课次数',
            trigger: 'change',
          },
        ],
        breakLimitAllV: [
          {
            required: true,
            message: '请输入累计爽约多次限制约课次数',
            trigger: 'change',
          },
        ],
        cancelLimit: [
          {
            required: true,
            message: '请输入上课前几小时不可取消',
            trigger: 'change',
          },
        ],
        cancelLimitV: [
          {
            required: true,
            message: '请输入上课前几小时不可取消',
            trigger: 'change',
          },
        ],
        courseLimit: [
          {
            required: true,
            message: '请输入上课前几小时不可约课',
            trigger: 'change',
          },
        ],
        courseLimitV: [
          {
            required: true,
            message: '请输入上课前几小时不可约课',
            trigger: 'change',
          },
        ],
        moneyLimit: [
          {
            required: true,
            message: '请输入欠费限制学员约课金额',
            trigger: 'change',
          },
        ],
        moneyLimitV: [
          {
            required: true,
            message: '请输入欠费限制学员约课金额',
            trigger: 'change',
          },
        ],
        cancelRuleFree: [
          {
            required: true,
            message: '请输入计时学车取消规则',
            trigger: 'change',
          },
        ],
        cancelRuleFree: [
          {
            required: true,
            message: '请输入计时学车取消规则',
            trigger: 'change',
          },
        ],
        cancelRuleDeduction: [
          {
            required: true,
            message: '请输入计时学车取消规则',
            trigger: 'change',
          },
        ],
        cancelRuleLimit: [
          {
            required: true,
            message: '请输入计时学车取消规则',
            trigger: 'change',
          },
        ],
        cancelRuleBreakRate: [
          {
            required: true,
            message: '请输入计时学车取消规则',
            trigger: 'change',
          },
        ],
      },
     rulesRuler3: {
       status: [
          {
            required: true,
            message: '请选择是否开启',
            trigger: 'change',
          },
        ],
        condition: [
          {
            required: true,
            message: '请选择约课条件',
            trigger: 'change',
          },
        ],
        conditionV: [
          {
            required: true,
            message: '请输入约课条件天数',
            trigger: 'change',
          },
        ],
        openTime: [
          {
            required: true,
            message: '请设置学员约课时间',
            trigger: 'change',
          },
        ],
        openTimeS: [
          {
            required: true,
            message: '请设置学员约课时间',
            trigger: 'change',
          },
        ],
        openTimeE: [
          {
            required: true,
            message: '请设置学员约课时间',
            trigger: 'change',
          },
        ],
        moreAppointDays: [
          {
            required: true,
            message: '请输入天数',
            trigger: 'change',
          },
        ],
        moreAppointTime: [
          {
            required: true,
            message: '请选择时间',
            trigger: 'change',
          },
        ],
        todayAppoint: [
          {
            required: true,
            message: '请设置是否可约当天课程',
            trigger: 'change',
          },
        ],
        learnTimeDay: [
          {
            required: true,
            message: '请设置每天可上课时间',
            trigger: 'change',
          },
        ],
        learnTimeDayS: [
          {
            required: true,
            message: '请设置每天可上课时间',
            trigger: 'change',
          },
        ],
        learnTimeDayE: [
          {
            required: true,
            message: '请设置每天可上课时间',
            trigger: 'change',
          },
        ],
        learnTimeWeek: [
          {
            required: true,
            message: '请设置每周可上课时间',
            trigger: 'change',
          },
        ],
        learnTimeWeekV: [
          {
            required: true,
            message: '请设置每周可上课时间',
            trigger: 'change',
          },
        ],
        courseList: [
          {
            required: true,
            message: '请设置课表可见天数',
            trigger: 'change',
          },
        ],
        courseListV: [
          {
            required: true,
            message: '请设置课表可见天数',
            trigger: 'change',
          },
        ],
        courseCountDay: [
          {
            required: true,
            message: '请设置每天可上课时段数',
            trigger: 'change',
          },
        ],
        courseCountDayV: [
          {
            required: true,
            message: '请设置每天可上课时段数',
            trigger: 'change',
          },
        ],
        courseCountWeek: [
          {
            required: true,
            message: '请设置每周可上课时段数',
            trigger: 'change',
          },
        ],
        courseCountWeekV: [
          {
            required: true,
            message: '请设置每周可上课时段数',
            trigger: 'change',
          },
        ],
        timeCountDay: [
          {
            required: true,
            message: '请设置每天最大时长',
            trigger: 'change',
          },
        ],
        timeCountDayV: [
          {
            required: true,
            message: '请设置每天最大时长',
            trigger: 'change',
          },
        ],
        timeCountWeek: [
          {
            required: true,
            message: '请设置每周最大时长',
            trigger: 'change',
          },
        ],
        timeCountWeekV: [
          {
            required: true,
            message: '请设置每周最大时长',
            trigger: 'change',
          },
        ],
        courseCountBefore: [
          {
            required: true,
            message: '请输入最大可提前预约时段数',
            trigger: 'change',
          },
        ],
        courseCountBeforeV: [
          {
            required: true,
            message: '请输入最大可提前预约时段数',
            trigger: 'change',
          },
        ],
        cancelLimitDay: [
          {
            required: true,
            message: '请输入每天取消约课总次数限制',
            trigger: 'change',
          },
        ],
        cancelLimitDayV: [
          {
            required: true,
            message: '请输入每天取消约课总次数限制',
            trigger: 'change',
          },
        ],
        cancelLimitAll: [
          {
            required: true,
            message: '请输入累计取消多次限制约课次数',
            trigger: 'change',
          },
        ],
        cancelLimitAllV: [
          {
            required: true,
            message: '请输入累计取消多次限制约课次数',
            trigger: 'change',
          },
        ],
        breakLimitAll: [
          {
            required: true,
            message: '请输入累计爽约多次限制约课次数',
            trigger: 'change',
          },
        ],
        breakLimitAllV: [
          {
            required: true,
            message: '请输入累计爽约多次限制约课次数',
            trigger: 'change',
          },
        ],
        cancelLimit: [
          {
            required: true,
            message: '请输入上课前几小时不可取消',
            trigger: 'change',
          },
        ],
        cancelLimitV: [
          {
            required: true,
            message: '请输入上课前几小时不可取消',
            trigger: 'change',
          },
        ],
        courseLimit: [
          {
            required: true,
            message: '请输入上课前几小时不可约课',
            trigger: 'change',
          },
        ],
        courseLimitV: [
          {
            required: true,
            message: '请输入上课前几小时不可约课',
            trigger: 'change',
          },
        ],
        moneyLimit: [
          {
            required: true,
            message: '请输入欠费限制学员约课金额',
            trigger: 'change',
          },
        ],
        moneyLimitV: [
          {
            required: true,
            message: '请输入欠费限制学员约课金额',
            trigger: 'change',
          },
        ],
        cancelRuleFree: [
          {
            required: true,
            message: '请输入计时学车取消规则',
            trigger: 'change',
          },
        ],
        cancelRuleFree: [
          {
            required: true,
            message: '请输入计时学车取消规则',
            trigger: 'change',
          },
        ],
        cancelRuleDeduction: [
          {
            required: true,
            message: '请输入计时学车取消规则',
            trigger: 'change',
          },
        ],
        cancelRuleLimit: [
          {
            required: true,
            message: '请输入计时学车取消规则',
            trigger: 'change',
          },
        ],
        cancelRuleBreakRate: [
          {
            required: true,
            message: '请输入计时学车取消规则',
            trigger: 'change',
          },
        ],
      },
      options: [
        { label: '周一', value: 1 },
        { label: '周二', value: 2 },
        { label: '周三', value: 3 },
        { label: '周四', value: 4 },
        { label: '周五', value: 5 },
        { label: '周六', value: 6 },
        { label: '周日', value: 7 },
      ],
    }
  },
  created(){
    this.getcourserule()
  },
  methods: {
    async getcourserule(){
       let data=await courserule()
        if(data.code=='0000' && data.data.length>0){
         let rule2 = data.data[0].rule
         let rule3 = data.data[1].rule
        rule2.conditionV=rule2.condition!=0?rule2.condition:''
        rule2.condition=rule2.condition!=0?1:rule2.condition
        rule2.openTimeS=rule2.openTime!=0?rule2.openTime.split('-')[0]:''
        rule2.openTimeE=rule2.openTime!=0?rule2.openTime.split('-')[1]:''
        rule2.openTime=rule2.openTime!=0?1:rule2.openTime
        rule2.learnTimeDayS=rule2.learnTimeDay!=0?rule2.learnTimeDay.split('-')[0]:''
        rule2.learnTimeDayE=rule2.learnTimeDay!=0?rule2.learnTimeDay.split('-')[1]:''
        rule2.learnTimeDay=rule2.learnTimeDay!=0?1:rule2.learnTimeDay
        rule2.learnTimeWeekV=rule2.learnTimeWeek!=0?rule2.learnTimeWeek.split(',').map(Number):''
        rule2.learnTimeWeek=rule2.learnTimeWeek!=0?1:rule2.learnTimeWeek
        rule2.moreAppointDays=rule2.moreAppoint.days
        rule2.moreAppointTime=rule2.moreAppoint.time
        rule2.courseListV=rule2.courseList!=0?rule2.courseList:''
        rule2.courseList=rule2.courseList!=0?1:rule2.courseList
        rule2.courseCountDayV=rule2.courseCountDay!=0?rule2.courseCountDay:''
        rule2.courseCountDay=rule2.courseCountDay!=0?1:rule2.courseCountDay
        rule2.courseCountWeekV=rule2.courseCountWeek!=0?rule2.courseCountWeek:''
        rule2.courseCountWeek=rule2.courseCountWeek!=0?1:rule2.courseCountWeek
        rule2.timeCountDayV=rule2.timeCountDay!=0?rule2.timeCountDay:''
        rule2.timeCountDay=rule2.timeCountDay!=0?1:rule2.timeCountDay
        rule2.timeCountWeekV=rule2.timeCountWeek!=0?rule2.timeCountWeek:''
        rule2.timeCountWeek=rule2.timeCountWeek!=0?1:rule2.timeCountWeek
        rule2.courseCountBeforeV=rule2.courseCountBefore!=0?rule2.courseCountBefore:''
        rule2.courseCountBefore=rule2.courseCountBefore!=0?1:rule2.courseCountBefore
        rule2.cancelLimitDayV=rule2.cancelLimitDay!=0?rule2.cancelLimitDay:''
        rule2.cancelLimitDay=rule2.cancelLimitDay!=0?1:rule2.cancelLimitDay
        rule2.cancelLimitAllV=rule2.cancelLimitAll!=0?rule2.cancelLimitAll:''
        rule2.cancelLimitAll=rule2.cancelLimitAll!=0?1:rule2.cancelLimitAll
        rule2.breakLimitAllV=rule2.breakLimitAll!=0?rule2.breakLimitAll:''
        rule2.breakLimitAll=rule2.breakLimitAll!=0?1:rule2.breakLimitAll
        rule2.cancelLimitV=rule2.cancelLimit!=0?rule2.cancelLimit:''
        rule2.cancelLimit=rule2.cancelLimit!=0?1:rule2.cancelLimit
        rule2.courseLimitV=rule2.courseLimit!=0?rule2.courseLimit:''
        rule2.courseLimit=rule2.courseLimit!=0?1:rule2.courseLimit
        rule2.moneyLimitV=rule2.moneyLimit!=0?rule2.moneyLimit:''
        rule2.moneyLimit=rule2.moneyLimit!=0?1:rule2.moneyLimit
        rule2.cancelRuleFree=rule2.cancelRule.free
        rule2.cancelRuleDeduction=rule2.cancelRule.deduction
        rule2.cancelRuleLimit=rule2.cancelRule.limit
        rule2.cancelRuleBreakRate=rule2.cancelRule.breakRate
        this.formDataRuler2={...rule2}
        //3
        rule3.conditionV=rule3.condition!=0?rule3.condition:''
        rule3.condition=rule3.condition!=0?1:rule3.condition
        rule3.openTimeS=rule3.openTime!=0?rule3.openTime.split('-')[0]:''
        rule3.openTimeE=rule3.openTime!=0?rule3.openTime.split('-')[1]:''
        rule3.openTime=rule3.openTime!=0?1:rule3.openTime
        rule3.learnTimeDayS=rule3.learnTimeDay!=0?rule3.learnTimeDay.split('-')[0]:''
        rule3.learnTimeDayE=rule3.learnTimeDay!=0?rule3.learnTimeDay.split('-')[1]:''
        rule3.learnTimeDay=rule3.learnTimeDay!=0?1:rule3.learnTimeDay
        rule3.learnTimeWeekV=rule3.learnTimeWeek!=0?rule3.learnTimeWeek.split(',').Map(Number):''
        rule3.learnTimeWeek=rule3.learnTimeWeek!=0?1:rule3.learnTimeWeek
        rule3.moreAppointDays=rule3.moreAppoint.days
        rule3.moreAppointTime=rule3.moreAppoint.time
        rule3.courseListV=rule3.courseList!=0?rule3.courseList:''
        rule3.courseList=rule3.courseList!=0?1:rule3.courseList
        rule3.courseCountDayV=rule3.courseCountDay!=0?rule3.courseCountDay:''
        rule3.courseCountDay=rule3.courseCountDay!=0?1:rule3.courseCountDay
        rule3.courseCountWeekV=rule3.courseCountWeek!=0?rule3.courseCountWeek:''
        rule3.courseCountWeek=rule3.courseCountWeek!=0?1:rule3.courseCountWeek
        rule3.timeCountDayV=rule3.timeCountDay!=0?rule3.timeCountDay:''
        rule3.timeCountDay=rule3.timeCountDay!=0?1:rule3.timeCountDay
        rule3.timeCountWeekV=rule3.timeCountWeek!=0?rule3.timeCountWeek:''
        rule3.timeCountWeek=rule3.timeCountWeek!=0?1:rule3.timeCountWeek
        rule3.courseCountBeforeV=rule3.courseCountBefore!=0?rule3.courseCountBefore:''
        rule3.courseCountBefore=rule3.courseCountBefore!=0?1:rule3.courseCountBefore
        rule3.cancelLimitDayV=rule3.cancelLimitDay!=0?rule3.cancelLimitDay:''
        rule3.cancelLimitDay=rule3.cancelLimitDay!=0?1:rule3.cancelLimitDay
        rule3.cancelLimitAllV=rule3.cancelLimitAll!=0?rule3.cancelLimitAll:''
        rule3.cancelLimitAll=rule3.cancelLimitAll!=0?1:rule3.cancelLimitAll
        rule3.breakLimitAllV=rule3.breakLimitAll!=0?rule3.breakLimitAll:''
        rule3.breakLimitAll=rule3.breakLimitAll!=0?1:rule3.breakLimitAll
        rule3.cancelLimitV=rule3.cancelLimit!=0?rule3.cancelLimit:''
        rule3.cancelLimit=rule3.cancelLimit!=0?1:rule3.cancelLimit
        rule3.courseLimitV=rule3.courseLimit!=0?rule3.courseLimit:''
        rule3.courseLimit=rule3.courseLimit!=0?1:rule3.courseLimit
        rule3.moneyLimitV=rule3.moneyLimit!=0?rule3.moneyLimit:''
        rule3.moneyLimit=rule3.moneyLimit!=0?1:rule3.moneyLimit
        rule3.cancelRuleFree=rule3.cancelRule.free
        rule3.cancelRuleDeduction=rule3.cancelRule.deduction
        rule3.cancelRuleLimit=rule3.cancelRule.limit
        rule3.cancelRuleBreakRate=rule3.cancelRule.breakRate
        this.formDataRuler3={...rule3}
        console.log( this.formDataRuler3)
      }
    },
    copyData(val){
      if(val==2){
        this.formDataRuler3={...this.formDataRuler2}
      }else{
        this.formDataRuler2={...this.formDataRuler3}
      }
      
    },
    //点击确认
    async confirmbtn() {
      let params = {}
      let formDataRuler2=false;
      let formDataRuler3=false;
      this.$refs['formDataRuler2'].validate(async (valid) => {
        if (!valid) return
        let condition,openTime,learnTimeDay,learnTimeWeek,todayAppoint,moreAppoint={},courseList,courseCountDay,courseCountWeek,timeCountDay,timeCountWeek,courseCountBefore,
        cancelLimitDay,cancelLimitAll,breakLimitAll,cancelLimit,courseLimit,moneyLimit,cancelRule={},status
         condition=this.formDataRuler2.conditionV?this.formDataRuler2.conditionV:this.formDataRuler2.condition
         openTime=this.formDataRuler2.openTime!=0?this.formDataRuler2.openTimeS+'-'+this.formDataRuler2.openTimeE:this.formDataRuler2.openTime
         learnTimeDay=this.formDataRuler2.learnTimeDay!=0?this.formDataRuler2.learnTimeDayS+'-'+this.formDataRuler2.learnTimeDayE:this.formDataRuler2.learnTimeDay
         learnTimeWeek=this.formDataRuler2.learnTimeWeekV?this.formDataRuler2.learnTimeWeekV.join(','):this.formDataRuler2.learnTimeWeek
         todayAppoint=this.formDataRuler2.todayAppoint
         if(this.formDataRuler2.moreAppointDays&&this.formDataRuler2.moreAppointTime){
            moreAppoint.days=this.formDataRuler2.moreAppointDays
            moreAppoint.time=this.formDataRuler2.moreAppointTime
         }
         courseList=this.formDataRuler2.courseListV?this.formDataRuler2.courseListV:this.formDataRuler2.courseList
         courseCountDay=this.formDataRuler2.courseCountDayV?this.formDataRuler2.courseCountDayV:this.formDataRuler2.courseCountDay
         courseCountWeek=this.formDataRuler2.courseCountWeekV?this.formDataRuler2.courseCountWeekV:this.formDataRuler2.courseCountWeek
         timeCountDay=this.formDataRuler2.timeCountDayV?this.formDataRuler2.timeCountDayV:this.formDataRuler2.timeCountDay
         timeCountWeek=this.formDataRuler2.timeCountWeekV?this.formDataRuler2.timeCountWeekV:this.formDataRuler2.timeCountWeek
         courseCountBefore=this.formDataRuler2.courseCountBeforeV?this.formDataRuler2.courseCountBeforeV:this.formDataRuler2.courseCountBefore
         cancelLimitDay=this.formDataRuler2.cancelLimitDayV?this.formDataRuler2.cancelLimitDayV:this.formDataRuler2.cancelLimitDay
         cancelLimitAll=this.formDataRuler2.cancelLimitAllV?this.formDataRuler2.cancelLimitAllV:this.formDataRuler2.cancelLimitAll
         breakLimitAll=this.formDataRuler2.breakLimitAllV?this.formDataRuler2.breakLimitAllV:this.formDataRuler2.breakLimitAll
         cancelLimit=this.formDataRuler2.cancelLimitV?this.formDataRuler2.cancelLimitV:this.formDataRuler2.cancelLimit
         courseLimit=this.formDataRuler2.courseLimitV?this.formDataRuler2.courseLimitV:this.formDataRuler2.courseLimit
         moneyLimit=this.formDataRuler2.moneyLimitV?this.formDataRuler2.moneyLimitV:this.formDataRuler2.moneyLimit
         if(this.formDataRuler2.cancelRuleFree&&this.formDataRuler2.cancelRuleDeduction&&this.formDataRuler2.cancelRuleLimit&&this.formDataRuler2.cancelRuleBreakRate){
            cancelRule.free=this.formDataRuler2.cancelRuleFree
            cancelRule.deduction=this.formDataRuler2.cancelRuleDeduction
            cancelRule.limit=this.formDataRuler2.cancelRuleLimit
            cancelRule.breakRate=this.formDataRuler2.cancelRuleBreakRate
         }
         status=this.formDataRuler2.status
         params.rule2={condition,openTime,learnTimeDay,learnTimeWeek,todayAppoint,moreAppoint,courseList,courseCountDay,courseCountWeek,timeCountDay,timeCountWeek,courseCountBefore,
        cancelLimitDay,cancelLimitAll,breakLimitAll,cancelLimit,courseLimit,moneyLimit,cancelRule,status}
         formDataRuler2=true
      })
      this.$refs['formDataRuler3'].validate(async (valid) => {
        if (!valid) return
         let condition,openTime,learnTimeDay,learnTimeWeek,todayAppoint,moreAppoint={},courseList,courseCountDay,courseCountWeek,timeCountDay,timeCountWeek,courseCountBefore,
        cancelLimitDay,cancelLimitAll,breakLimitAll,cancelLimit,courseLimit,moneyLimit,cancelRule={},status
         condition=this.formDataRuler3.conditionV?this.formDataRuler3.conditionV:this.formDataRuler3.condition
         openTime=this.formDataRuler3.openTime!=0?this.formDataRuler3.openTimeS+'-'+this.formDataRuler3.openTimeE:this.formDataRuler3.openTime
         learnTimeDay=this.formDataRuler3.learnTimeDay!=0?this.formDataRuler3.learnTimeDayS+'-'+this.formDataRuler3.learnTimeDayE:this.formDataRuler3.learnTimeDay
         learnTimeWeek=this.formDataRuler3.learnTimeWeekV?this.formDataRuler3.learnTimeWeekV.join(','):this.formDataRuler3.learnTimeWeek
         todayAppoint=this.formDataRuler3.todayAppoint
         if(this.formDataRuler3.moreAppointDays&&this.formDataRuler3.moreAppointTime){
            moreAppoint.days=this.formDataRuler3.moreAppointDays
            moreAppoint.time=this.formDataRuler3.moreAppointTime
         }
         courseList=this.formDataRuler3.courseListV?this.formDataRuler3.courseListV:this.formDataRuler3.courseList
         courseCountDay=this.formDataRuler3.courseCountDayV?this.formDataRuler3.courseCountDayV:this.formDataRuler3.courseCountDay
         courseCountWeek=this.formDataRuler3.courseCountWeekV?this.formDataRuler3.courseCountWeekV:this.formDataRuler3.courseCountWeek
         timeCountDay=this.formDataRuler3.timeCountDayV?this.formDataRuler3.timeCountDayV:this.formDataRuler3.timeCountDay
         timeCountWeek=this.formDataRuler3.timeCountWeekV?this.formDataRuler3.timeCountWeekV:this.formDataRuler3.timeCountWeek
         courseCountBefore=this.formDataRuler3.courseCountBeforeV?this.formDataRuler3.courseCountBeforeV:this.formDataRuler3.courseCountBefore
         cancelLimitDay=this.formDataRuler3.cancelLimitDayV?this.formDataRuler3.cancelLimitDayV:this.formDataRuler3.cancelLimitDay
         cancelLimitAll=this.formDataRuler3.cancelLimitAllV?this.formDataRuler3.cancelLimitAllV:this.formDataRuler3.cancelLimitAll
         breakLimitAll=this.formDataRuler3.breakLimitAllV?this.formDataRuler3.breakLimitAllV:this.formDataRuler3.breakLimitAll
         cancelLimit=this.formDataRuler3.cancelLimitV?this.formDataRuler3.cancelLimitV:this.formDataRuler3.cancelLimit
         courseLimit=this.formDataRuler3.courseLimitV?this.formDataRuler3.courseLimitV:this.formDataRuler3.courseLimit
         moneyLimit=this.formDataRuler3.moneyLimitV?this.formDataRuler3.moneyLimitV:this.formDataRuler3.moneyLimit
         if(this.formDataRuler3.cancelRuleFree&&this.formDataRuler3.cancelRuleDeduction&&this.formDataRuler3.cancelRuleLimit&&this.formDataRuler3.cancelRuleBreakRate){
            cancelRule.free=this.formDataRuler3.cancelRuleFree
            cancelRule.deduction=this.formDataRuler3.cancelRuleDeduction
            cancelRule.limit=this.formDataRuler3.cancelRuleLimit
            cancelRule.breakRate=this.formDataRuler3.cancelRuleBreakRate
         }
            status=this.formDataRuler3.status
         params.rule3={condition,openTime,learnTimeDay,learnTimeWeek,todayAppoint,moreAppoint,courseList,courseCountDay,courseCountWeek,timeCountDay,timeCountWeek,courseCountBefore,
        cancelLimitDay,cancelLimitAll,breakLimitAll,cancelLimit,courseLimit,moneyLimit,cancelRule,status}
         formDataRuler3=true;
      })
      if(!formDataRuler2 && !formDataRuler3){
        return;
      }
      let data=await courseruleSetting(params)
      if(data.code=='0000'){
         this.$message.success(data.msg)
         this.getcourserule()
      }
    },
  },
}
</script>

<style scoped lang='scss'>
.inline {
  display: inline-block;
}
::v-deep {
  .el-input-group__append {
    width: 40px;
    padding: 0;
    text-align: center;
  }
}
.sub {
  border: 1px solid #e6e6e6;
  &.left {
    border-right: none;
  }
  h3 {
    border-bottom: 1px solid #e6e6e6;
    line-height: 46px;
    .fuzhibtn {
      font-weight: normal;
      font-size: 12px;
      color: #4c68ef;
      cursor: pointer;
      float: right;
      margin-right: 20px;
    }
  }
  .tips {
    display: block;
    font-size: 12px;
    color: #868686;
  }
  .addColor {
    color: #000;
  }
}
</style>